#ifndef HIGHSCORES_H
#define HIGHSCORES_H

#include <QWidget>
#include <QString>
#include <vector>

using namespace std;

namespace Ui {
class Highscores;
}

class Score {
    QString username;
    int score;

public:
    Score(QString initName, int initScore = 0) : username(initName), score(initScore) { }

    // Getters
    QString getUsername() {return username;}
    int getScore() {return score;}

    // Setters
    void setUsername(QString initName) {username = initName;}
    void setScore(int initScore){score = initScore;}

    ~Score() { }
};

class Highscores : public QWidget
{
    Q_OBJECT

public:
    explicit Highscores(QWidget *parent = 0);
    ~Highscores();

    void addHighscores(QString name, int score, int duration);
    void showAllTheScores();

    // Methods for scores_1
    void initScores1();
    void addHighscore1(QString name, int score);
    void showScores1();
    Score* getScore1(int index) {return scores_1.at(index);}

    // Methods for scores_2
    void initScores2();
    void addHighscore2(QString name, int score);
    void showScores2();
    Score* getScore2(int index) {return scores_2.at(index);}

    // Methods for scores_3
    void initScores3();
    void addHighscore3(QString name, int score);
    void showScores3();
    Score* getScore3(int index) {return scores_3.at(index);}

signals:
    void updateWindowState(bool m, bool g, bool s, bool h);
    
private slots:
    void on_btnClose_clicked();
    void closeEvent(QCloseEvent* event);

private:
    Ui::Highscores *ui;

    // scores vectors
    vector<Score*> scores_1;
    vector<Score*> scores_2;
    vector<Score*> scores_3;
};

#endif // HIGHSCORES_H
